package com.waimai1.waimai.common;

import lombok.Data;

/**
 * 添加R
 */
@Data
public class R<T> {
    private Integer code=200;
    private T data=null;
    private String message="ok";
    R(T data){
        this.code=200;
        this.data=data;
        this.message="chenggong";
    }
    R(Integer code, String message){
        this.code=code;
        this.data=null;
        this.message=message;
    }
    static public <T> R<T> success(T data){
        R<T> r=new R<>(data);
        return r;
    }
    static public <T> R<T> err(Integer code,String message){
        R<T> r=new R<>(code,message);
        return r;
    }
}
